





	;===============
	;=
	;= TILES
	;=
	;===============

	.MODULE "tiles"






redraw_tiles
   
   
   
   
   
   
   
unpk_attr
    ;A = level
    add a, a
    ld e, a
    ld d, 0
    ld hl, attr_tab
    add hl, de
    ld e, (hl)
    inc hl
    ld d, (hl)
    call decode_entry
    call page
_upkatt1
    ;HL = ptr to packed attr
    ;unpack nibless to attr buffer
    ld de, attr_buf
_upkatt4
    ld c, (hl)
    inc hl
    ld a, c
    and $F0
    ld b, 1
    jr nz, _upkatt3
    ld a, c
    and %0F
    ret z
    ld b, a
    ld c, (hl)
    inc hl
_upkatt2
    ld a, c          
_upkatt3
    ld (de), a
    inc de
    djnz _upkatt3
    jr _upkatt4    